import request from '@/utils/request';
const api_name = '/star';

export default {
  // 通过房源ID和用户ID查询一个收藏
  getStarById(houseId, userId) {
    return request({
      url: `${api_name}/${houseId}/${userId}`,
      method: 'get'
    });
  },
  // 根据房源ID和用户ID删除一个收藏
  removeStarById(houseId, userId) {
    return request({
      url: `${api_name}/${houseId}/${userId}`,
      method: 'delete'
    });
  },
  // 新增一个收藏
  saveStar(houseId, userId) {
    return request({
      url: `${api_name}/${houseId}/${userId}`,
      method: 'post'
    });
  },
  // 查询"我的"收藏
  getStar(userId){
    return request({
      url: `${api_name}/${userId}`,
      method: 'get'
    });
  }
};
